package com.aaa.controller.tables;

import com.aaa.dao.AuthorMapper;
import com.aaa.service.impl.AuthorServiceImpl;
import com.wsc.entity.Author;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("author")
public class AuthorController {
    @Resource
    AuthorServiceImpl authorService;
    @Resource
    AuthorMapper authorMapper;
    @RequestMapping("select")
    public Object select(){
       return   authorService.select();
    }
    @RequestMapping("insert")
    public Integer insert(Author author){
        return authorService.insert(author);
    }
    @RequestMapping("delete")
    public Integer delete(Integer id){
        return authorMapper.deleteById(id);
    }
    @RequestMapping("update")
    public Integer update(Author author){
        return authorMapper.updateById(author);
    }


}
